	capture log close
	set more off
	//cd -- Change working directory if you don't want to 
	*hardcode in the log and data locations
	


	//  program:	Replication file of standing committee votes APPENDIX. 
	//  task:       replicate results in APPENDIX, summer 2019 - ASSOCIATED WITH LSQ R&R 072119
	//	project: 	Standing committee votes
	//  author:     Josh Ryan \ Summer 2019
	// related files: replicationfile_v1_081818, reportvotedat_v6_032319.dta, replicationfile_v3_072919

	// #Start
	// program setup



use "reportvotedat_v6_032319.dta", clear


*Table: Bill Characteristics and Chamber Passage Support-
		
	gen chamyeaperscale=chamyeaper/100
	fracreg probit chamyeaperscale chairorrank mref majority absdwnom percentyea i.stewartcommid i.cong
	estimates store frac1
	estat ic
	margins, at(percentyea=(50(10)100))
	
	fracreg probit  chamyeaperscale chairorrank mref majority absdwnom majpartyvotes i.stewartcommid i.cong
	estimates store frac2
	estat ic
	margins, at(majpartyvotes=(0(10)100))

	fracreg probit  chamyeaperscale chairorrank mref majority absdwnom minpartyvotes i.stewartcommid i.cong
	estimates store frac3
	estat ic
	margins, at(minpartyvotes=(0(10)100))

	estout frac1 frac2 frac3, style(tex) cells(b(star fmt(2)) se(par)) starlevels($^\#$ .1 * 0.05) stats(aic N r2_p) varlabels( ///
	chairorrank	"Chair or Ranking Mem. of Referral Committee" mref "Member of Referral Committee" majority "Sponsor Member of Majority" absdwnom "Sponsor Ideological Extremity" ///
	percentyea "Overall Percentage Voting to Report Bill" majpartyvotes "Majority Percentage to Report" minpartyvotes "Minority Percentage to Report")
	
	
	*Table: Ordered Logit Estimates of Bill Characteristics and Bill Progression
	meologit  bprog chairorrank mref majority absdwnom percentyea i.cong i.stewartcommid
	estimates store bprog1
	estat ic
	meologit  bprog chairorrank mref majority absdwnom percentyea i.cong i.stewartcommid, or
	
	meologit bprog chairorrank mref majority absdwnom majpartyvotes i.cong i.stewartcommid
	estimates store bprog2
	estat ic
	meologit bprog chairorrank mref majority absdwnom majpartyvotes i.cong i.stewartcommid, or
	
	meologit bprog chairorrank mref majority absdwnom minpartyvotes i.cong i.stewartcommid
	estimates store bprog3
	estat ic
	meologit bprog chairorrank mref majority absdwnom minpartyvotes i.cong i.stewartcommid, or
	
	estout bprog1 bprog2 bprog3, style(tex) cells(b(star fmt(2)) se(par)) starlevels($^\#$ .1 * 0.05) stats(aic N) varlabels( ///
	chairorrank	"Chair or Ranking Mem. of Referral Committee" mref "Member of Referral Committee" majority "Sponsor Member of Majority" absdwnom "Sponsor Ideological Extremity" ///
	percentyea "Overall Percentage Voting to Report Bill" majpartyvotes "Majority Percentage to Report" minpartyvotes "Minority Percentage to Report")
	
	*Table: Robustness Check: Controlling for Overall Chamber Support, Majority Party Support, and Minority Party Support 
*on Percentage of House Voting to Pass, Probability of Passage, and Probability of Congressional Passage

fracreg probit chamyeaperscale chairorrank mref majority absdwnom percentyea majpartyvotes minpartyvotes i.stewartcommid i.cong
estimates store robustall1
estat ic

logit passh chairorrank mref majority absdwnom percentyea majpartyvotes minpartyvotes i.stewartcommid i.cong, cluster(stewartcommid) 
estimates store robustall2	
estat ic
logit passh chairorrank mref majority absdwnom percentyea majpartyvotes minpartyvotes i.stewartcommid i.cong, cluster(stewartcommid) or
	
logit passcong chairorrank mref majority absdwnom percentyea majpartyvotes minpartyvotes i.stewartcommid i.cong, cluster(stewartcommid)
estimates store robustall3
estat ic
logit passcong chairorrank mref majority absdwnom percentyea majpartyvotes minpartyvotes i.stewartcommid i.cong, cluster(stewartcommid) or

estout robustall1 robustall2 robustall3, style(tex) cells(b(star fmt(2)) se(par)) starlevels($^\#$ .1 * 0.05) stats(aic N r2_p) varlabels( ///
	chairorrank	"Chair or Ranking Mem. of Referral Committee" mref "Member of Referral Committee" majority "Sponsor Member of Majority" absdwnom "Sponsor Ideological Extremity" ///
	percentyea "Overall Percentage Voting to Report Bill" majpartyvotes "Majority Percentage to Report" minpartyvotes "Minority Percentage to Report")
	
*Table: Senate Minority Party Seats and Support on Committee Votes to Report--Frac Probit for Appendix
gen percentyeascale=percentyea/100
fracreg probit percentyeascale chairorrank mref majority absdwnom c.senmajpartyno##i.divcham i.stewartcommid 
estimates store comvotes1
estat ic

gen majpartyvotesscale=majpartyvotes/100
fracreg probit majpartyvotesscale chairorrank mref majority absdwnom c.smajpartymem##i.divcham i.stewartcommid 
estimates store comvotes2
estat ic

gen minpartyvotesscale=minpartyvotes/100 	
fracreg probit minpartyvotesscale chairorrank mref majority absdwnom c.senmajpartyno##i.divcham i.stewartcommid 
estimates store comvotes3
estat ic
margins, at(senmajpartyno=(51(1)60))

	
*Table: Senate Minority Party Seats and Minority Support on Committee Votes to Report|Sample Split by Divided and Unified Chambers

	
fracreg probit minpartyvotesscale chairorrank mref majority absdwnom c.senmajpartyno i.stewartcommid if divcham==0
estimates store split1

fracreg probit minpartyvotesscale chairorrank mref majority absdwnom c.senmajpartyno i.stewartcommid if divcham==1
estimates store split2

estout split1 split2, style(tex) cells(b(star fmt(2)) se(par)) starlevels($^\#$ .1 * 0.05) stats(aic N r2_p) varlabels( ///
	chairorrank	"Chair or Ranking Mem. of Referral Committee" mref "Member of Referral Committee" majority "Sponsor Member of Majority" absdwnom "Sponsor Ideological Extremity" ///
	percentyea "Overall Percentage Voting to Report Bill" majpartyvotes "Majority Percentage to Report" minpartyvotes "Minority Percentage to Report" ///
	divcham "Divided Govt" c.smajpartymem##i.divcham "House Majority Party Senators x Divided Govt")

	
	
*Appendix Figure - Voting Density Used for Interaction	
hist senmajpartyno, width(1) percent color(gs14) ///
ytitle("Percentage of Obs.") xtitle("Number of Senate Majority Party Seats") ///
ylabel(0(5)30, valuelabel) ///
xlabel(51(1)60, valuelabel) scheme(s1mono) graphregion(fcolor(white) ifcolor(white)) title("")


*Table: Exogenous Senate Party Changes and Minority Support on Committee Votes to Report--Frac Reg Probit
use "partyswitches_v4_032319.dta", clear

gen percentyeascale=percentyea/100
fracreg probit percentyeascale chairorrank majority mref absdwnom dminseats i.cong i.stewartcommid
estimates store switch1
	
gen majpartyvotesscale=majpartyvotes/100
fracreg probit majpartyvotesscale chairorrank majority mref absdwnom dminseats i.cong i.stewartcommid
estimates store switch2
	
gen minpartyvotesscale=minpartyvotes/100
fracreg probit minpartyvotesscale chairorrank majority mref absdwnom c.dminseats i.cong i.stewartcommid
estimates store switch3
margins, at(dminseats=(51(1)60)) level(90)


estout switch1 switch2 switch3, style(tex) cells(b(star fmt(2)) se(par)) starlevels($^\#$ .1 * 0.05) stats(aic N) varlabels(chairorrank	"Member of Referral Committee" mref "Multiple Referral" ///
majority "Sponsor Member of Majority" absdwnom "Ideological Extremity" dminseats "Number of Senate Majority Party Members")


	
	
	*Table: Appendix: Exogenous Senate Party Changes and Minority Support--Alternative Specifications
	
	reg minpartyvotes chairorrank majority mref absdwnom c.dminseats i.cong i.stewartcommid, cluster(stewartcommid)
	estimates store switch1app
	
	reg minpartyvotes chairorrank majority mref absdwnom dminseats i.cong i.stewartcommid, r
	estimates store switch1app
	
	reg minpartyvotes chairorrank majority mref absdwnom dminseats i.cong i.stewartcommid, r
	estimates store switch1app
	
	reg minpartyvotes chairorrank majority mref absdwnom dminseats i.cong i.stewartcommid
	estimates store switch2app
	
	reg minpartyvotes chairorrank majority mref absdwnom c.dminseats i.stewartcommid, cluster(stewartcommid)
	estimates store switch3app
	
estout switch1app switch2app switch3app, style(tex) cells(b(star fmt(2)) se(par)) starlevels(* 0.05) stats(aic N) varlabels(chairorrank	"Member of Referral Committee" mref "Multiple Referral" ///
majority "Sponsor Member of Majority" absdwnom "Ideological Extremity" dminseats "Number of Senate Majority Party Members")
	
	

*Regression results--dropping judiciary and energy and commerce committees as suggested by reviewer and mentioned in the paper
//
//
//
//
//


use "reportvotedat_v6_032319.dta", clear

drop if stewartcommid==156
drop if stewartcommid==128


*Table: OLS Estimates of Bill Characteristics and Chamber Passage Support
	reg  chamyeaper chairorrank mref majority absdwnom percentyea i.stewartcommid i.cong, cluster(stewartcommid)
	estimates store base1
	estat ic
	
	reg chamyeaper chairorrank mref majority absdwnom majpartyvotes i.stewartcommid i.cong, r cluster(stewartcommid)
	estimates store base2
	estat ic
	
	reg chamyeaper chairorrank mref majority absdwnom minpartyvotes i.stewartcommid i.cong, r cluster(stewartcommid)
	estimates store base3
	estat ic
	
	estout base1 base2 base3, style(tex) cells(b(star fmt(2)) se(par)) starlevels($^\#$ .1 * 0.05) stats(aic N) varlabels( ///
	chairorrank	"Chair or Ranking Mem. of Referral Committee" mref "Member of Referral Committee" majority "Sponsor Member of Majority" absdwnom "Sponsor Ideological Extremity" ///
	percentyea "Overall Percentage Voting to Report Bill" majpartyvotes "Majority Percentage to Report" minpartyvotes "Minority Percentage to Report")
	
	

	

	*Table: Bill Characteristics and House Passage
	logit  passh chairorrank mref majority absdwnom percentyea i.stewartcommid i.cong, cluster(stewartcommid)
	estimates store passh1
	estat ic
	logit  passh chairorrank mref majority absdwnom percentyea i.stewartcommid i.cong, cluster(stewartcommid) or
	
	logit passh chairorrank mref majority absdwnom majpartyvotes i.stewartcommid i.cong, cluster(stewartcommid)
	estimates store passh2
	estat ic
	logit passh chairorrank mref majority absdwnom majpartyvotes i.stewartcommid i.cong, cluster(stewartcommid) or
	
	logit passh chairorrank mref majority absdwnom minpartyvotes i.stewartcommid i.cong, cluster(stewartcommid) 
	estimates store passh3	
	estat ic
	logit passh chairorrank mref majority absdwnom minpartyvotes i.stewartcommid i.cong, cluster(stewartcommid) or
	
	logit  passcong chairorrank mref majority absdwnom percentyea i.stewartcommid i.cong, cluster(stewartcommid) 
	estimates store plaw1
	estat ic
	logit  passcong chairorrank mref majority absdwnom percentyea i.stewartcommid i.cong, cluster(stewartcommid) or
	
	logit passcong chairorrank mref majority absdwnom majpartyvotes i.stewartcommid i.cong, cluster(stewartcommid) 
	estimates store plaw2
	estat ic
	logit passcong chairorrank mref majority absdwnom majpartyvotes i.stewartcommid i.cong, cluster(stewartcommid) or
	
	logit passcong chairorrank mref majority absdwnom minpartyvotes i.stewartcommid i.cong, cluster(stewartcommid)
	estimates store plaw3
	estat ic
	logit passcong chairorrank mref majority absdwnom minpartyvotes i.stewartcommid i.cong, cluster(stewartcommid) or
	beep

	estout passh1 passh2 passh3 plaw1 plaw2 plaw3, style(tex) cells(b(star fmt(2)) se(par)) starlevels($^\#$ .1 * 0.05) stats(aic N r2_p) varlabels( ///
	chairorrank	"Chair or Ranking Mem. of Referral Committee" mref "Member of Referral Committee" majority "Sponsor Member of Majority" absdwnom "Sponsor Ideological Extremity" ///
	percentyea "Overall Percentage Voting to Report Bill" majpartyvotes "Majority Percentage to Report" minpartyvotes "Minority Percentage to Report")
	
	
	
use "partyswitches_v4_032319.dta", clear

*Table: Senate Minority Party Seats and Support on Committee Votes to Report--OLS
reg percentyea chairorrank mref majority absdwnom c.senmajpartyno##i.divcham i.stewartcommid , cluster(stewartcommid)
estimates store comvotes1
estat ic

reg majpartyvotes chairorrank mref majority absdwnom c.smajpartymem##i.divcham i.stewartcommid , cluster(stewartcommid)
estimates store comvotes2
estat ic
 	
reg minpartyvotes chairorrank mref majority absdwnom c.senmajpartyno##i.divcham i.stewartcommid , cluster(stewartcommid)
estimates store comvotes3
estat ic

estout comvotes1 comvotes2 comvotes3, style(tex) cells(b(star fmt(2)) se(par)) starlevels($^\#$ .1 * 0.05) stats(aic N) varlabels( ///
	chairorrank	"Chair or Ranking Mem. of Referral Committee" mref "Member of Referral Committee" majority "Sponsor Member of Majority" absdwnom "Sponsor Ideological Extremity" ///
	percentyea "Overall Percentage Voting to Report Bill" majpartyvotes "Majority Percentage to Report" minpartyvotes "Minority Percentage to Report" ///
	divcham "Divided Govt" c.smajpartymem##i.divcham "House Majority Party Senators x Divided Govt")
	

	
		*Table: OLS Estimates of Exogenous Senate Party Changes and Minority Support on Committee Votes to Report

drop if stewartcommid==156
drop if stewartcommid==128

reg percentyea chairorrank majority mref absdwnom dminseats i.cong i.stewartcommid, cluster(stewartcommid)
estimates store switch1
	
reg majpartyvotes chairorrank majority mref absdwnom dminseats i.cong i.stewartcommid, cluster(stewartcommid)
estimates store switch2
	
reg minpartyvotes chairorrank majority mref absdwnom c.dminseats i.cong i.stewartcommid, cluster(stewartcommid) level(90)
estimates store switch3
	
estout switch1 switch2 switch3, style(tex) cells(b(star fmt(2)) se(par)) starlevels($^\#$ .1 * 0.05) stats(aic N r2) varlabels(chairorrank	"Member of Referral Committee" mref "Multiple Referral" ///
majority "Sponsor Member of Majority" absdwnom "Ideological Extremity" dminseats "Number of Senate Majority Party Members")

	
	
	